<extend name="Public/layout" />

<block name="content">
<section class="wrapper site-min-height">
    <!-- page start-->
    <section class="panel">
        <header class="panel-heading">
            管理员设置
            <span class="pull-right">
                <!--<a href="#add_auth" data-toggle="modal" class=" btn btn-success btn-xs">
                    <i class="fa fa-plus"></i> 新增
                </a>-->
                <a href="{:U('Admin/AdminUser/add')}" class=" btn btn-success btn-xs">
                    <i class="fa fa-plus"></i> 新增
                </a>
                <button type="button" class="btn btn-warning btn-xs" onclick="window.location.reload()">
                    <i class="fa fa-refresh"></i> 刷新
                </button>
            </span>
        </header>
        <div class="panel-body">
            <div class="row">
                <div class="col-md-12">
                    <form class="form-inline" role="form" action="{:U('Admin/AdminUser/index')}" method="get">
                        <div class="form-group">
                            <label class="sr-only" for="username">用户名</label>
                            用户名 <input name="username" value="{$Think.get.username}" type="text" id="username" class="form-control"  placeholder="请输入搜索用户名">
                        </div>
                        <div class="form-group">
                            <label class="sr-only" for="realname">真实姓名</label>
                            真实姓名 <input name="realname" value="{$Think.get.realname}" type="text" id="realname" class="form-control"  placeholder="请输入搜索真实姓名">
                        </div>
                        <div class="form-group">
                            <label class="sr-only" for="phone">手机号码</label>
                            手机号码 <input name="phone" value="{$Think.get.phone}" type="text" id="phone" class="form-control"  placeholder="请输入搜索手机号码">
                        </div>

                        <div class="form-group">
                            <label class="sr-only" for="status">状态</label>
                            状态
                            <select name="status" id="status" class="form-control">
                                <option value="">请选择</option>
                                <option value="0" >启用</option>
                                <option value="1" >禁用</option>
                            </select>
                        </div>
                        <button type="submit" class="btn btn-info">
                            <i class="fa fa-search"></i>
                            搜索
                        </button>
                    </form>
                </div>

            </div>
        </div>
        <hr style="margin:1px 0px; "/>
        <div class="panel-body">
            <div class="table-responsive" tabindex="1" style="overflow: hidden; outline: none;">
                <table class="table table-bordered table-hover">
                    <thead>
                    <tr>
                        <th>ID</th>
                        <th>用户名</th>
                        <th>真实姓名</th>
                        <th>手机号码</th>
                        <th>邮箱</th>
                        <th>角色类型</th>
                        <th>上次登录时间</th>
                        <th>上次登录IP</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <notempty name="list.list">


                    <volist name="list.list" id="vo">
                    <tr>
                        <td>{$vo.id}</td>
                        <td>{$vo.username}</td>
                        <td>{$vo.realname}</td>
                        <td>{$vo.phone}</td>
                        <td>{$vo.email}</td>
                        <td>{$vo.role_name}</td>
                        <td>{$vo.last_login_time|date='Y-m-d H:i:s',###}</td>
                        <td>{$vo.last_login_ip}</td>
                        <td>
                            {$vo['status']==1?'禁用':'启用'}
                        </td>
                        <td width="20%">

                            <a href="{:U('Admin/AdminUser/edit')}?id={$vo.id}" class="btn btn-info btn-xs">
                                <i class="fa fa-pencil"></i> 编辑
                            </a>
                            <a href="javascript:;" ajax-msg="确认{$vo['status']==0?'禁用':'启用'}" ajax-url="{:U('Admin/AdminUser/change')}?id={$vo.id}&status={$vo['status']?'0':'1'}" class="btn btn-warning btn-xs ajax-action-btn">
                                <i class="fa fa-lock"></i> {$vo['status']==0?'禁用':'启用'}
                            </a>
                            <a href="javascript:;" ajax-msg="确认删除?" ajax-url="{:U('Admin/AdminUser/del')}?id={$vo.id}" class="btn btn-danger btn-xs ajax-action-btn">
                                <i class="fa fa-trash-o"></i> 删除
                            </a>
                        </td>
                    </tr>
                    </volist>
                        <else/>
                        <tr><td colspan="9" align="center">暂无数据</td></tr>
                    </notempty>
                    </tbody>
                </table>
            </div>
            <!--分页-->
            <div class="text-center">
                {$list.page}
            </div>
        </div>
    </section>
</section>
</block>

<block name="javascript">
<script>
    //菜单高亮
    MenuHighlight('{:U("Admin/AdminUser/index")}');
</script>
</block>